package com.xhl.doeverything.es.index;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.io.Serializable;

/**
 * 学生索引库
 *
 * @author xionghuilong
 * @date 2021/04/06 11:59
 **/
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
@Document(indexName = "#{@studentIndexName}", type = "_doc")
public class IndexStudent implements Serializable {

    private static final long serialVersionUID = 2739969169092000002L;

    @Id
    private String id;
    /**
     * 学生姓名
     */
    @Field(type = FieldType.Text, analyzer="ik_max_word", searchAnalyzer="ik_max_word")
    private String name;
    /**
     * 身高
     */
    @Field(type = FieldType.Keyword)
    private String height;
    /**
     * 体重
     */
    @Field(type = FieldType.Keyword)
    private String weight;
    /**
     * 联系电话
     */
    @Field(type = FieldType.Keyword)
    private String telephone;
    /**
     * 生日
     */
    @Field(type = FieldType.Keyword)
    private String birthday;
    /**
     * 描述信息
     */
    @Field(type = FieldType.Text, analyzer="ik_max_word", searchAnalyzer="ik_max_word")
    private String desc;

}

